In the conventional technology, when a specified number of random numbers are to be generated, usually the specified number of random numbers are generated randomly by invoking a random function. However, the random numbers cannot be effectively controlled (for example, keeping the random numbers within a range) because the random numbers are generated randomly. As a result, the specified number of random numbers generated are unevenly distributed. For example, in a scenario in which sending of “red packets” is implemented, a “red packet amount” randomly generated by a payment service end may be extremely large, or may be extremely small (for example, 0.01). This may bring about relatively poor experience for a user.